package com.amazon.ags.jni.leaderboards;

import android.util.Log;
import com.amazon.ags.api.AGResponseHandle;
import com.amazon.ags.api.AmazonGamesClient;
import com.amazon.ags.api.RequestResponse;
import com.amazon.ags.api.leaderboards.GetLeaderboardPercentilesResponse;
import com.amazon.ags.api.leaderboards.GetLeaderboardsResponse;
import com.amazon.ags.api.leaderboards.GetPlayerScoreResponse;
import com.amazon.ags.api.leaderboards.GetScoresResponse;
import com.amazon.ags.api.leaderboards.LeaderboardsClient;
import com.amazon.ags.api.leaderboards.SubmitScoreResponse;
import com.amazon.ags.constants.LeaderboardFilter;

public class LeaderboardsNativeHandler
{
  private static String TAG = "LeaderboardsNativeHandler";
  private static LeaderboardsClient m_LeaderboardsClient = null;

  public static void getPercentiles(String paramString, int paramInt1, int paramInt2, long paramLong)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "getPercentiles - initializeJni was not called beforehand.");
      return;
    }
    m_LeaderboardsClient.getPercentileRanks(paramString, LeaderboardFilter.fromOrdinal(paramInt1), new Object[0]).setCallback(new GetPercentilesJniResponseHandler(paramInt2, paramLong));
  }

  public static AGResponseHandle<GetLeaderboardPercentilesResponse> getPercentilesHandle(String paramString, int paramInt1, int paramInt2)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "getPercentilesHandle - initializeJni was not called beforehand.");
      return null;
    }
    LeaderboardsClient localLeaderboardsClient = m_LeaderboardsClient;
    LeaderboardFilter localLeaderboardFilter = LeaderboardFilter.fromOrdinal(paramInt1);
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt2);
    return localLeaderboardsClient.getPercentileRanks(paramString, localLeaderboardFilter, arrayOfObject);
  }

  public static void initializeNativeHandler(AmazonGamesClient paramAmazonGamesClient)
  {
    m_LeaderboardsClient = paramAmazonGamesClient.getLeaderboardsClient();
  }

  public static void requestLeaderboards(int paramInt, long paramLong)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "requestLeaderboards - initializeJni was not called beforehand.");
      return;
    }
    m_LeaderboardsClient.getLeaderboards(new Object[0]).setCallback(new GetLbsJniResponseHandler(paramInt, paramLong));
  }

  public static AGResponseHandle<GetLeaderboardsResponse> requestLeaderboardsHandle(int paramInt)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "requestLeaderboardsHandle - initializeJni was not called beforehand.");
      return null;
    }
    LeaderboardsClient localLeaderboardsClient = m_LeaderboardsClient;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    return localLeaderboardsClient.getLeaderboards(arrayOfObject);
  }

  public static void requestLocalPlayerScore(String paramString, int paramInt1, int paramInt2, long paramLong)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "requestLocalPlayerScore - initializeJni was not called beforehand.");
      return;
    }
    m_LeaderboardsClient.getLocalPlayerScore(paramString, LeaderboardFilter.fromOrdinal(paramInt1), new Object[0]).setCallback(new GetScoreJniResponseHandler(paramString, paramInt2, paramLong));
  }

  public static AGResponseHandle<GetPlayerScoreResponse> requestLocalPlayerScoreHandle(String paramString, int paramInt1, int paramInt2)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "requestLocalPlayerScoreHandle - initializeJni was not called beforehand.");
      return null;
    }
    LeaderboardsClient localLeaderboardsClient = m_LeaderboardsClient;
    LeaderboardFilter localLeaderboardFilter = LeaderboardFilter.fromOrdinal(paramInt1);
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt2);
    return localLeaderboardsClient.getLocalPlayerScore(paramString, localLeaderboardFilter, arrayOfObject);
  }

  public static void requestScores(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4, long paramLong)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "requestScores - initializeJni was not called beforehand.");
      return;
    }
    m_LeaderboardsClient.getScores(paramString, LeaderboardFilter.fromOrdinal(paramInt1), paramInt2, paramInt3, new Object[0]).setCallback(new GetScoresJniResponseHandler(paramInt4, paramLong));
  }

  public static AGResponseHandle<GetScoresResponse> requestScoresHandle(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "requestScoresHandle - initializeJni was not called beforehand.");
      return null;
    }
    LeaderboardsClient localLeaderboardsClient = m_LeaderboardsClient;
    LeaderboardFilter localLeaderboardFilter = LeaderboardFilter.fromOrdinal(paramInt1);
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt4);
    return localLeaderboardsClient.getScores(paramString, localLeaderboardFilter, paramInt2, paramInt3, arrayOfObject);
  }

  public static AGResponseHandle<RequestResponse> showLeaderboardOverlay(String paramString)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "showLeaderboardOverlay - initializeJni was not called beforehand.");
      return null;
    }
    return m_LeaderboardsClient.showLeaderboardOverlay(paramString, new Object[0]);
  }

  public static AGResponseHandle<RequestResponse> showLeaderboardsOverlay()
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "showLeaderboardsOverlay - initializeJni was not called beforehand.");
      return null;
    }
    return m_LeaderboardsClient.showLeaderboardsOverlay(new Object[0]);
  }

  public static void submitLeaderboardScore(String paramString, long paramLong1, int paramInt, long paramLong2)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "submitLeaderboardScore - initializeJni was not called beforehand.");
      return;
    }
    m_LeaderboardsClient.submitScore(paramString, paramLong1, new Object[0]).setCallback(new SubmitScoreJniResponseHandler(paramInt, paramLong2));
  }

  public static AGResponseHandle<SubmitScoreResponse> submitLeaderboardScoreHandle(String paramString, long paramLong, int paramInt)
  {
    if (m_LeaderboardsClient == null)
    {
      Log.e(TAG, "submitLeaderboardScoreHandle - initializeJni was not called beforehand.");
      return null;
    }
    LeaderboardsClient localLeaderboardsClient = m_LeaderboardsClient;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    return localLeaderboardsClient.submitScore(paramString, paramLong, arrayOfObject);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.ags.jni.leaderboards.LeaderboardsNativeHandler
 * JD-Core Version:    0.6.2
 */